#ifndef _DARBER_IPFS_
#define _DARBER_IPFS_

#include <stdlib.h>
#include <stdint.h>

void darber_ipfs_check_launch_status(void);

// file
int open_file(const char *file);
int reopen_file(const char *file);
int write_file(const char *file,const char *string);
int rewrite_file(const char *file,const char *string);
int read_file(char *buffer,size_t size);
int close_file(void);
void ensure_local_dir(const char *path,const char *dir);

int read_print_file(const char *file);

void darber_ipfs_get_local(void);

// pthread
#include <pthread.h>
typedef void (*darber_thread_body)(void *);
typedef int (*darber_while_wait)(void *);
typedef int (*darber_thread_till)(void);

pthread_t darber_thread(darber_thread_body body);
pthread_t darber_thread_while(darber_thread_body body);
pthread_t darber_thread_while_wait(darber_while_wait body);


typedef struct fun_while_till
{
    darber_thread_body loop;
    darber_thread_till condition;
}pth_func_while_till;


//
void test_gateway_connect_time(void);

//
void curl_test(void);

#endif

// end of file -----------------------------------------------------------------
